<!--#Include File="../conn.asp" -->
<!--#Include File="comm/inc.asp" -->
<!--#Include File="../include/cls_template.asp"-->
<%
'====================================================================
'= Team Elite - Elite Article System
'= Copyright (c) 2005 - 2006 Eason Chan All Rights Reserved.
'=-------------------------------------------------------------------
'= 版权协议：
'=	GPL (The GNU GENERAL PUBLIC LICENSE Version 2, June 1991)
'=-------------------------------------------------------------------
'= 文件名称：/Manager/Admin_MakeList.asp
'= 摘    要：后台-HTML栏目页生成文件
'=-------------------------------------------------------------------
'= 最后更新：eason007
'= 最后日期：2006-04-07
'====================================================================

Server.ScriptTimeout=9999999

Call EA_Manager.Chk_IsMaster

If Not EA_Manager.Chk_Power(Admin_Power,"42") Then 
	ErrMsg=str_Comm_NotAccess
	Call EA_Manager.Error(1)
End If

Dim Atcion,PostId
Dim ChildColumnList
Dim SysKeyword, SysDesc
Atcion=Request.QueryString ("atcion")

Select Case LCase(Atcion)
Case "mark"
	SysKeyword	= EA_Pub.SysInfo(16)
	SysDesc		= EA_Pub.SysInfo(17)

	Call MarkList
Case Else
	Call Main
End Select
Call EA_Pub.Close_Obj
Set EA_Pub=Nothing

Sub Main
	Dim Level,Temp,i
	Dim ColumnList

	Temp=EA_DBO.Get_Column_List()
	If IsArray(Temp) Then
		For i=0 To UBound(Temp,2)
			Level=(Len(Temp(2,i))/4-1)*2
			ColumnList = ColumnList & "<option value="""&Temp(0,i)&""">"
			If Len(Temp(2,i))>4 Then ColumnList = ColumnList & "├"
			ColumnList = ColumnList & String(Level,"-")
			ColumnList = ColumnList & Temp(1,i)&"</option>"
		Next
	End If

	PageContent=Template.LoadTemplate("admin_makelist_main.htm")

	Template.SetVariable "Language_Comm_Select",str_Comm_Select,PageContent
	Template.SetVariable "Language_Comm_SelectAll",str_Comm_SelectAll,PageContent
	Template.SetVariable "Language_Comm_Submit_Button",str_Comm_Submit_Button,PageContent

	Template.SetVariable "ColumnList",ColumnList,PageContent

	Template.SetVariable "Language_OperationNotice",str_OperationNotice,PageContent
	Template.SetVariable "Language_MakeList_Help",str_MakeList_Help,PageContent

	Template.SetVariable "Language_MakeList_Title",str_MakeList_Title,PageContent
	Template.SetVariable "Language_MakeList_AllColumn",str_Comm_AllColumn,PageContent
	Template.SetVariable "Language_MakeList_Option_1",str_MakeList_Option_1,PageContent
	Template.SetVariable "Language_MakeList_Option_2",str_MakeList_Option_2,PageContent
	Template.SetVariable "Language_MakeList_Option_3",str_MakeList_Option_3,PageContent
	Template.SetVariable "Language_MakeList_Option_4",str_MakeList_Option_4,PageContent
	Template.SetVariable "Language_MakeList_Option_5",str_MakeList_Option_5,PageContent
	Template.SetVariable "Language_MakeList_Option_6",str_MakeList_Option_6,PageContent
	Template.SetVariable "Language_MakeList_Option_7",str_MakeList_Option_7,PageContent
	Template.SetVariable "Language_MakeList_Option_8",str_MakeList_Option_8,PageContent


	Template.BaseReplace PageContent
	Template.OutStr PageContent
End Sub

Sub MarkList
	Dim SelType,ColumnList,PostId
	Dim k,l,TmpStr
	
	Call EA_Pub.Chk_Post
	
	PostId=EA_Pub.SafeRequest(2,"postid",0,0,0)
	SelType=EA_Pub.SafeRequest(2,"seltype",1,"",0)
	
	SQL="Select [Id] from [NB_Column]"
	If PostId<>0 Then SQL=SQL&" Where [Id]="&PostId
	Set Rs=Conn.Execute(SQL)
	
	If Not rs.eof And Not rs.bof Then 
		ColumnList=Rs.GetRows()
		
		PageContent=Template.LoadTemplate("admin_makelist_view.htm")

		Template.SetVariable "ColumnTotal",Ubound(ColumnList,2)+1,PageContent
		Template.SetVariable "Language_MakeList_Column",str_MakeList_Column,PageContent
		Template.SetVariable "Language_MakeList_Now",str_MakeList_Now,PageContent
		Template.SetVariable "Language_MakeList_Task",str_MakeList_Task,PageContent
		Template.SetVariable "Language_MakeList_Page",str_MakeList_Page,PageContent

		Template.BaseReplace PageContent
		Response.Write PageContent
		
		For k=0 To Ubound(ColumnList,2)
			TmpStr=Split(SelType,", ")
			
			Response.Write "<script>task_total.innerHTML="""&UBound(TmpStr)+1&""";</script>" & VbCrLf
			For l=0 To UBound(TmpStr)
				Response.Write "<script>page_total.innerHTML=""1"";</script>" & VbCrLf
				Response.Write "<script>page_complete.innerHTML=""1"";</script>" & VbCrLf
				Response.Write "<script>img3.width=1;</script>" & VbCrLf
					
				Select Case TmpStr(l)
				Case "1"
					MakeColumn ColumnList(0,k),"AddDate","Desc"
				Case "2"
					MakeColumn ColumnList(0,k),"AddDate","Asc"
				Case "3"
					MakeColumn ColumnList(0,k),"Title","Desc"
				Case "4"
					MakeColumn ColumnList(0,k),"Title","Asc"
				Case "5"
					MakeColumn ColumnList(0,k),"ViewNum","Desc"
				Case "6"
					MakeColumn ColumnList(0,k),"ViewNum","Asc"
				Case "7"
					MakeColumn ColumnList(0,k),"CommentNum","Desc"
				Case "8"
					MakeColumn ColumnList(0,k),"CommentNum","Asc"
				End Select
				
				If UBound(TmpStr)=0 Then
					Response.Write "<script>img2.width=400;" & VbCrLf
				Else
					Response.Write "<script>img2.width=" & Fix((l/UBound(TmpStr)) * 400) & ";" & VbCrLf
				End If
				Response.Write "task_complete.innerHTML=""<font color=green>"&l+1&"</font>"";</script>" & VbCrLf
				Response.Flush
			Next
			
			If Ubound(ColumnList,2)=0 Then
				Response.Write "<script>img1.width=400;" & VbCrLf
			Else
				Response.Write "<script>img1.width=" & Fix((k/Ubound(ColumnList,2)) * 400) & ";" & VbCrLf
			End If
			Response.Write "column_complete.innerHTML=""<font color=blue>"&k+1&"</font>"";</script>" & VbCrLf
			Response.Flush
		Next
	End If
	
	Response.Write "<script>make_msg.innerHTML="""&str_MakeList_AllComplate&""";</script>" & VbCrLf
	
	Rs.Close
	Set Rs=Nothing
End Sub

Function MakeColumn(ColumnId,Field,Order)
	Dim TopicNav,PageNumNav
	Dim PageContent
	Dim PageCount,PageSize
	Dim Tmp,i,j,TempStr
	Dim ArticleList,ColumnInfo,ArticleOutStr
	Dim FileName,Folder,FileNameExample
	Dim re
	Dim ShowUrl
	Set re=New RegExp
	re.IgnoreCase =true
	re.Global=True
	
	'load column data
	ColumnInfo=EA_DBO.Get_Column_Info(ColumnId)
	
	Set EA_Temp=New cls_Template
	
	PageSize=ColumnInfo(17,0)
	ShowUrl = ColumnInfo(18,0)
	
	
	'转换栏目路径函数
	'输入参数：
	'	1、栏目id
	'	2、路径类型
	FileName=EA_Pub.Cov_ColumnPath(ColumnId, "0",ColumnInfo(1,0))'path

	Dim ShowUrlList
	ShowUrlList = EA_Pub.Get_ShowUrlByColumnCode(ColumnInfo(1,0))
	'For i=0 To UBound(TempArray,2)
'				TempStr=TempStr&" >> <a href="""&Cov_ColumnPath(TempArray(0,i),SysInfo(18))&""">"&TempArray(1,i)&"</a>"
'			Next
	'jump to out url
	
	re.Pattern=Replace(SystemFolder, "/", "\/") & "(.*)\/(\w+).(\w+)"
	Folder = re.Replace(FileName,"/$1/")
	Folder = Replace(Folder, "adddate", Field)
	Folder = Replace(Folder, "desc", Order)

	re.Pattern="(.*)_(\d+).(\w+)"
	FileNameExample = re.Replace(FileName,"$1")

	If Not(EA_Pub.CheckDir(".." & Folder)) Then 
		Tmp = Split(Folder, "/")
		TempStr = ""

		For j = 1 To UBound(Tmp)-1
			TempStr = TempStr & "/" & Tmp(j)

			If Not(EA_Pub.CheckDir(".." & TempStr)) Then EA_Pub.MakeNewsDir Server.MapPath(".." & TempStr)
		Next
	End If
	
	
	
	PageContent=EA_Temp.Load_Template(ColumnInfo(9,0),"list")

	PageCount=EA_Pub.Stat_Page_Total(PageSize,ColumnInfo(3,0))
	
	If PageCount=0 Then
		Response.Write "<script>page_total.innerHTML=""1"";</script>" & VbCrLf
	Else
		Response.Write "<script>page_total.innerHTML="""&PageCount&""";</script>" & VbCrLf
	End If
	
	EA_Temp.Title=ColumnInfo(0,0)&" - "&EA_Pub.SysInfo(0)
	EA_Temp.Nav="<a href="""&SystemFolder&""">"&EA_Pub.SysInfo(0)&"</a> "&EA_Pub.Get_NavByColumnCode(ColumnInfo(1,0))

	
	
	
	If ColumnInfo(6,0) Then 
		PageContent="<meta http-equiv=""refresh"" content=""0;URL="&ColumnInfo(7,0)&""">"

		'FileName = Replace(FileName, "adddate", Field)
		'FileName = Replace(FileName, "desc", Order)
		
		Call EA_Pub.Save_HtmlFile(FileName,PageContent)
		Exit Function	
	End If
		
		PageContent=Replace(PageContent,"{$ColumnId$}",ColumnId)
		PageContent=Replace(PageContent,"{$ColumnName$}",ColumnInfo(0,0))
		PageContent=Replace(PageContent,"{$ColumnInfo$}",ColumnInfo(2,0))
		PageContent=Replace(PageContent,"{$ColumnTopicTotal$}",ColumnInfo(3,0))
		PageContent=Replace(PageContent,"{$ColumnMangerTotal$}",ColumnInfo(4,0))
		PageContent=Replace(PageContent,"{$ColumnTitleNav$}",TopicNav)
		PageContent=Replace(PageContent,"{$ColumnNav$}",SiteColumnNav(ColumnId,ColumnInfo(1,0)))
		PageContent=Replace(PageContent,"{$ChildColumn$}",ColumnChild(ColumnInfo(1,0)))

		EA_Temp.Find_TemplateTagByInput "ChildColumnNav",ChildColumnNav(PageContent),PageContent

		EA_Pub.SysInfo(16)=ColumnInfo(0,0)&","&SysKeyword
		If Len(ColumnInfo(2,0)) Then EA_Pub.SysInfo(17)=ColumnInfo(2,0)
		
		PageContent=EA_Temp.Replace_PublicTag(PageContent)

		Call EA_Temp.Find_TemplateTags("Friend",PageContent)
		
		If PageCount=0 Then 
			PageContent=Replace(PageContent,"{$ColumnTopicList$}","此栏目暂时没有文章")
			PageContent=Replace(PageContent,"{$ColumnPageNumNav$}","")

			'FileName = Replace(FileName, "adddate", Field)
			'FileName = Replace(FileName, "desc", Order)
			
			Call EA_Pub.Save_HtmlFile(FileName,PageContent)
			
			Exit Function 
		End If
		
			For j=1 To PageCount
				Response.Write "<script>img3.width=" & Fix((j/PageCount) * 400) & ";" & VbCrLf
				Response.Write "page_complete.innerHTML=""<b>"&j&"</b>"";</script>" & VbCrLf
				Response.Flush
	
				'load article list
				If ColumnInfo(3,0)>0 Then 
					If Rs.State=1 Then Rs.Close
					
					SQL="SELECT [Id], TColor, Title, AddDate, CommentNum, Summary, LastComment, ViewNum, IsImg, Img, IsTop ,TrueTime "
					SQL=SQL&"FROM NB_Content "
					SQL=SQL&"WHERE ColumnId="&ColumnId&" And IsPass="&EA_DBO.TrueValue&" And IsDel=0 "
					SQL=SQL&"ORDER BY "
					If Field="AddDate" Then 
						SQL=SQL&"TrueTime"
					Else
						SQL=SQL&Field
					End If
					SQL=SQL&" "&Order
					Rs.Open SQL,Conn,1,1

					If Not rs.eof And Not rs.bof Then 
						Rs.AbsolutePosition=Rs.AbsolutePosition+((j-1)*PageSize)
						ArticleList=Rs.GetRows(PageSize)
					End If
				End If
		
				'make article list
				ArticleOutStr="<table width = '770px' >"
				'--------输出---------
				If IsArray(ArticleList) Then
	'				ArticleOutStr=ArticleOutStr&"<tr><td>"
	'				ArticleOutStr=ArticleOutStr&"<script type=""text/javascript"">"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"var RCount="&UBound(ArticleList,2)&";"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"var TopicList=[];"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"var SysStyle=0;"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"var SystemFolder='"&SystemFolder&"';"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"
'
	'				ArticleOutStr=ArticleOutStr&"<xml id=""xmlArticleList"">"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"<Article>"&vbcrlf
	''				ArticleOutStr=ArticleOutStr&"<List>"&vbcrlf
	'				ArticleOutStr=ArticleOutStr&"<Content>"&vbcrlf
						
	'				ArticleOutStr=ArticleOutStr&"<![CDATA["&vbcrlf
					For i=0 To UBound(ArticleList,2)
						'ArticleOutStr=ArticleOutStr&ArticleList(0,i)&"|"  id
						'ArticleOutStr=ArticleOutStr&ArticleList(1,i)&"|" 0
						'ArticleOutStr=ArticleOutStr&EA_Pub.Base_HTMLFilter(ArticleList(2,i))&"|" title
						'ArticleOutStr=ArticleOutStr&FormatDateTime(ArticleList(3,i),2)&"|" date
						'ArticleOutStr=ArticleOutStr&ArticleList(4,i)&"|"' null
						'ArticleOutStr=ArticleOutStr&EA_Pub.DealJsText(ArticleList(5,i))&"|" null
						'ArticleOutStr=ArticleOutStr&ArticleList(6,i)&"|" 4
						'ArticleOutStr=ArticleOutStr&ArticleList(7,i)&"|" False
						'ArticleOutStr=ArticleOutStr&ArticleList(8,i)&"|" false
						'ArticleOutStr=ArticleOutStr&ArticleList(9,i)&"|" null
						'ArticleOutStr=ArticleOutStr&ArticleList(10,i)&"|"'false
						'ArticleOutStr=ArticleOutStr&EA_Pub.Cov_ArticlePath(ArticleList(0,i),ArticleList(3,i),EA_Pub.SysInfo(18))'url
						'ArticleOutStr=ArticleOutStr&"{{}}"
						ArticleOutStr = ArticleOutStr&"<tr><td width=""10px""></td><td>"& VbCrLf
						ArticleOutStr = ArticleOutStr&CheckTitleTypes(ArticleList(8,i),ArticleList(10,i),SystemFolder)'加文章类型
						ArticleOutStr = ArticleOutStr&"<a href='"&EA_Pub.Cov_ArticlePath(ArticleList(0,i),ArticleList(3,i),ArticleList(11,i),EA_Pub.SysInfo(18))&"' rel='external'>"&TitleAddColor(EA_Pub.Base_HTMLFilter(ArticleList(2,i)),ArticleList(1,i))&"</a></td>"
						ArticleOutStr = ArticleOutStr&"<td align=""right"" width=""120px"">"
						ArticleOutStr = ArticleOutStr&"["&EA_Pub.FormatDate(ArticleList(3,i),2)&"]"
						ArticleOutStr = ArticleOutStr&"</td></tr>"& VbCrLf
					Next
					'ArticleOutStr=ArticleOutStr&"]]>"&vbcrlf
		
					'ArticleOutStr=ArticleOutStr&"</Content>"&vbcrlf
					'ArticleOutStr=ArticleOutStr&"</List>"&vbcrlf
					'ArticleOutStr=ArticleOutStr&"</Article>"&vbcrlf
					'ArticleOutStr=ArticleOutStr&"</xml>"&vbcrlf

					'ArticleOutStr=ArticleOutStr&"<span id=""CommentList"">正在读取...</span>"&vbcrlf

					'ArticleOutStr=ArticleOutStr&"</td></tr>"&vbcrlf
					ArticleOutStr=ArticleOutStr&"</table>"

					'ArticleOutStr=ArticleOutStr&"<script type=""text/javascript"" src="""&SystemFolder&
					'ArticleOutStr=ArticleOutStr&"<script type=""text/javascript"">ShowList("&ColumnInfo(8,0)&");
				Else
					ArticleOutStr=ArticleOutStr&"<tr><td style=""height: 50px; "">此栏目暂时没有文章</td></tr>"
					ArticleOutStr=ArticleOutStr&"</table>"
				End If
	
				'PageNumNav=PageList(j,PageCount,"Article_"&ColumnId&"_"&Field&"_"&Order&"_")
				PageNumNav=PageList(j,PageCount,left(FileName,len(FileName)-4))
				
				TempStr=PageContent
				
				TempStr=Replace(TempStr,"{$ColumnTopicList$}",ArticleOutStr)
				TempStr=Replace(TempStr,"{$ColumnPageNumNav$}",PageNumNav)

				'Tmp = Replace(FileName, "adddate", Field)
				'Tmp = Replace(Tmp, "desc", Order)
				if(j=1) then
				Call EA_Pub.Save_HtmlFile(FileName,TempStr)
				end if
				
				Tmp = Replace(FileName, "index.htm", "index_" & j & ".htm")
				
				Call EA_Pub.Save_HtmlFile(Tmp,TempStr)' path  content
			Next
		Response.Write "<script>img3.width=400;</script>" & VbCrLf
End Function
'标题加颜色
function TitleAddColor(vTitle,vTColor)
	if vTcolor=1 then
		TitleAddColor = "<font color='#FF0000'>"&vTitle&"</font>"
	end if
	if vTcolor=2 then
		TitleAddColor = "<font color='#37a61c'>"&vTitle&"</font>"
	end if
	if vTcolor=3 then  
		TitleAddColor = "<font color='#0066CC'>"&vTitle&"</font>"
	end if
	TitleAddColor = vTitle
end function
'标题加类型
function CheckTitleTypes(vIsImg,vIsTop,SystemFolder)
	dim PicUrl
	picUrl = SystemFolder
	
	if vIsImg="True" then
		CheckTitleTypes =  "<img src='"&PicUrl&"images/public/article_img.gif' alt='图片文章' />&nbsp;"
	else if vIsTop="True" then
			CheckTitleTypes =  "<img src='"&PicUrl&"images/public/article_top.gif' alt='推荐文章' />&nbsp;"
		else
			CheckTitleTypes =  "<img src='"&PicUrl&"images/public/article_normal.gif' alt='普通文章' />&nbsp;"
		end if
	end if
end function




Function ChildColumnNav(Page)
	Dim ChilColumnConfig
	Dim Temp,OutStr,Column,i,j

	Temp = Split(ChildColumnList,"|")

	ChilColumnConfig = EA_Temp.Find_TemplateTagValues("ChildColumnNav",Page)
	If Not IsArray(ChilColumnConfig) Then Exit Function

	j = 1
	For i=0 To UBound(Temp)-1
		Column = Split(Temp(i),",")

		OutStr = OutStr & "<li><a href="""&EA_Pub.Cov_ColumnPath(Column(0),EA_Pub.SysInfo(18))&""">"&Column(1)
		OutStr = OutStr & "</a></li>"

		If j = CLng(ChilColumnConfig(1)) Then Exit For
		j = j + 1
		'If (i+1) Mod ChilColumnConfig(0) = 0 And (i+1) <= (UBound(Temp)-1) Then OutStr = OutStr & "<br>"
	Next

	ChildColumnNav = OutStr
End Function

Function SiteColumnNav(ColumnId,ColumnCode)
	Dim TempArray,TempStr
	Dim i,StepLen
	
	ChildColumnList = ""
	TempArray=EA_DBO.Get_Column_Nav(ColumnCode)
	
	TempStr="<table>"
	If IsArray(TempArray) Then 
		For i=0 To UBound(TempArray,2)
			StepLen=(Len(TempArray(1,i))/4)*2-2
			If Len(TempArray(1,i)) = Len(ColumnCode)+4 And ColumnCode = Left(TempArray(1,i),Len(ColumnCode)) Then ChildColumnList = ChildColumnList & TempArray(0,i) & "," & TempArray(2,i) & "|"

			TempStr=TempStr&"<tr><td>&nbsp;"
			If Len(TempArray(1,i))>4 Then 
				TempStr=TempStr&"├"
				TempStr=TempStr&String(StepLen,"-")
			End If
			If CLng(TempArray(0,i))=CLng(ColumnId) Then 
				TempStr=TempStr&"<img src="""&SystemFolder&"images/public/icon2.gif"" alt="""" />"
			Else
				TempStr=TempStr&"<img src="""&SystemFolder&"images/public/icon.gif"" alt="""" />"
			End If
			TempStr=TempStr&"<a href="""&EA_Pub.Cov_ColumnPath(TempArray(0,i),"0",ColumnCode)&""">"&TempArray(2,i)
			TempStr=TempStr&"</a>"
			If TempArray(4,i) Then TempStr=TempStr&"[专]"
			TempStr=TempStr&"&nbsp;<span style=""color: #aaaaaa;"">("&TempArray(5,i)&")</span>"
			TempStr=TempStr&"</td>"
			TempStr=TempStr&"</tr>"
		Next
	End If
	TempStr=TempStr&"</table>"
	
	SiteColumnNav=TempStr
End Function

Function ColumnChild(MainCode)
	Dim ChildList,Title,TopicList
	Dim j,i
	Dim OurStr
	
	ChildList=EA_DBO.Get_Column_ChildList(MainCode)
	If IsArray(ChildList) Then 
		For i=0 To Ubound(ChildList,2)
			OurStr=OurStr&"<table>"&Chr(10)
			OurStr=OurStr&"<tr>"&Chr(10)
			OurStr=OurStr&"<td>&nbsp;<strong>"&ChildList(1,i)&"</strong>&nbsp;&nbsp;&nbsp;文章总数:"&ChildList(2,i)&"&nbsp;浏览次数:"&ChildList(3,i)&"</td>"&Chr(10)
			OurStr=OurStr&"<td><a href="""&EA_Pub.Cov_ColumnPath(ChildList(0,i),EA_Pub.SysInfo(18),MainCode)&"""><img src="""&SystemFolder&"images/more.gif"" alt="""" /></a>&nbsp;</td>"&Chr(10)
			OurStr=OurStr&"</tr>"&Chr(10)
			
			TopicList=EA_DBO.Get_Article_ByColumnId(ChildList(0,i),1,10)
			If IsArray(TopicList) Then 
				OurStr=OurStr&"<tr>"&Chr(10)
				OurStr=OurStr&"<td colspan=""2"">"&Chr(10)
				OurStr=OurStr&"<table>"&Chr(10)
				For j=0 To Ubound(TopicList,2)
					Title=Replace(TopicList(2,j),"&nbsp;","")
					OurStr=OurStr&"<tr>"&Chr(10)
					OurStr=OurStr&"<td>&nbsp;<a href="""&EA_Pub.Cov_ArticlePath(TopicList(0,j),TopicList(3,j),TopicList(13,j),EA_Pub.SysInfo(18))&""" rel=""external"">"
					OurStr=OurStr&EA_Pub.Add_ArticleColor(TopicList(1,j),Title)
					OurStr=OurStr&"</a>"
					OurStr=OurStr&EA_Pub.Chk_ArticleTime(TopicList(3,j))
					OurStr=OurStr&"</td>"
					OurStr=OurStr&"<td>"
					OurStr=OurStr&"&nbsp;"&FormatDateTime(TopicList(3,j),2)&"&nbsp;Browse:"&TopicList(7,j)&""
					OurStr=OurStr&"</td>"&Chr(10)
					OurStr=OurStr&"</tr>"&Chr(10)
					OurStr=OurStr&"<tr>"&Chr(10)
					OurStr=OurStr&"<td height='1'></td>"&Chr(10)
					OurStr=OurStr&"</tr>"&Chr(10)
				Next
				OurStr=OurStr&"</table>"&Chr(10)
				OurStr=OurStr&"</td>"&Chr(10)
				OurStr=OurStr&"</tr>"&Chr(10)
			Else
				OurStr=OurStr&"<tr><td style=""height: 50px;"">此栏目暂时没有文章</td></tr>"&Chr(10)
			End If
			OurStr=OurStr&"</table>"&Chr(10)
		Next
	End If
	
	ColumnChild=OurStr
End Function

Function PageList(iCurrentPage,iPageCount,Http)
	Dim OutStr
	Dim PageRoot, PageFoot
	Dim i

		If CLng(iCurrentPage)<=0 Then 
			iCurrentPage=1
		ElseIf CLng(iCurrentPage)>CLng(iPageCount) Then
			iCurrentPage=iPageCount
		End if
		
		If iCurrentPage-4<=1 Then 
			PageRoot=1
		Else
			PageRoot=iCurrentPage-4
		End If	
		If iCurrentPage+4>=iPageCount Then 
			PageFoot=iPageCount
		Else
			PageFoot=iCurrentPage+4
		End If

	OutStr="<div id=""pageList"">"

	If Clng(iCurrentPage)<=1 Then 
		OutStr=OutStr&"<span class=""hidden"">&laquo;</span>&nbsp;"
		OutStr=OutStr&"<span class=""hidden"">&lt;</span>&nbsp;"
	Else
		OutStr=OutStr&"<span class=""first""><a href='"
		OutStr=OutStr&Http&".htm' title=""Go to first page"">"
		OutStr=OutStr&"&laquo;</a></span>&nbsp;"
		OutStr=OutStr&"<span class=""list""><a href='"
		OutStr=OutStr&Http&"_"&iCurrentPage-1&".htm' title=""Go to previous page"">"
		OutStr=OutStr&"&lt;</a></span>&nbsp;"
	End If

		For i=PageRoot To PageFoot
			If i=Cint(iCurrentPage) Then
				OutStr=OutStr&"<span class=""current"">"&i&"</span>&nbsp;"
			Else
				OutStr=OutStr&"<span class=""list""><a href="""&Http&"_"&i&".htm"
				OutStr=OutStr&""" title="""&i&""">"&i&"</a></span>&nbsp;"
			End If
			If i=iPageCount Then Exit For
		Next

	If Clng(iCurrentPage)>=iPageCount Then 
		OutStr=OutStr&"<span class=""hidden"">&gt;</span>&nbsp;"
		OutStr=OutStr&"<span class=""hidden"">&raquo;</span>&nbsp;"	
	Else
		OutStr=OutStr&"<span class=""list""><a href='"
		OutStr=OutStr&Http&"_"&iCurrentPage+1&".Htm' title=""Go to next page"">"
		OutStr=OutStr&"&gt;</a></span>&nbsp;"
		OutStr=OutStr&"<span class=""last""><a href='"
		OutStr=OutStr&Http&"_"&iPageCount&".Htm' title=""Go to last page"">"
		OutStr=OutStr&"&raquo;</a></span>&nbsp;"
	End If
	
	OutStr=OutStr&"<span class=""list"">"&Clng(iCurrentPage)&"/"&iPageCount&"</span>"

	OutStr=OutStr&"</div>"

	PageList=OutStr
End Function
%>